/**
 * @Project : ProgrammingExercises
 * @Package : ACWing._2LanQiao._5BinaryIndexedTree_SegmentTree
 * @File : Q797.java
 * @Author : WangRuoyu
 * @Date 2023/3/17 21:56
 */

package acwing._2LanQiao._5BinaryIndexedTree_SegmentTree;

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

/**
 * @Project : ProgrammingExercises
 * @Package : ACWing._2LanQiao._5BinaryIndexedTree_SegmentTree
 * @File : Q0797.java
 * @Author : WangRuoyu
 * @Date 2023/3/17 21:56
 */
public class Q0797 {

    static void insert(int[] b, int l, int r, int c) {
        b[l] += c;
        b[r + 1] -= c;
    }

    public static void main(String[] args) throws IOException {
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        String[] words = br.readLine().split(" ");

        int n = Integer.parseInt(words[0]);
        int m = Integer.parseInt(words[1]);
        int[] a = new int[n];
        int[] b = new int[n + 1];

        words = br.readLine().split(" ");
        for (int i = 0; i < n; i++) {
            a[i] = Integer.parseInt(words[i]);
            insert(b, i, i, a[i]);
        }

        for (int i = 0; i < m; i++) {
            words = br.readLine().split(" ");
            int l = Integer.parseInt(words[0]);
            int r = Integer.parseInt(words[1]);
            int c = Integer.parseInt(words[2]);
            insert(b, l - 1, r - 1, c);
        }

        for (int i = 0; i < n; i++) {
            if (i == 0) {
                System.out.print(b[i] + " ");
                continue;
            }
            b[i] += b[i - 1];
            System.out.print(b[i] + " ");
        }
    }
}

